//package com.doge.walknovel
//
//import androidx.lifecycle.Lifecycle
//import androidx.lifecycle.LifecycleObserver
//import androidx.lifecycle.OnLifecycleEvent
//import androidx.lifecycle.ProcessLifecycleOwner
//import com.doge.walknovel.utils.log
//
//object AppLifecycle {
//    enum class State { START, STOP, }
//
//    private var state: State = State.STOP
//    val isForeground: Boolean get() = state == State.START
//
//    fun init() {
//        ProcessLifecycleOwner.get().lifecycle.addObserver(object : LifecycleObserver {
//            @OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
//            fun onAppPause() {
//                log("AppLifecycleObserver onAppPause")
//                state = State.STOP
//            }
//
//            @OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
//            fun onAppResume() {
//                log("AppLifecycleObserver onAppResume")
//                state = State.START
//            }
//        })
//    }
//}